﻿<catel:DataWindow x:Class="Catel.Articles._04___Unit_testing.UI.Windows.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:ViewModels="clr-namespace:Catel.Articles._04___Unit_testing.UI.ViewModels"
                  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                  xmlns:catel="http://catel.codeplex.com"
                  x:TypeArguments="ViewModels:MainWindowViewModel"
                  MinHeight="350" MinWidth="525" ShowInTaskbar="True"
                  Icon="/Catel.Articles.04 - Unit testing;component/Resources/Images/Catel.png">

    <!-- Resources -->
    <Window.Resources>
    </Window.Resources>

    <!-- Content -->
    <DockPanel LastChildFill="True">
        <!-- Details and actions -->
        <StackPanel DockPanel.Dock="Right" Orientation="Vertical">
            <!-- Buttons -->
            <WrapPanel>
                <!-- Added -->
                <Button Command="{Binding Add}" Style="{DynamicResource ImageButtonStyle}">
                    <Image Source="/Catel.Articles.04 - Unit testing;component/Resources/Images/add.png"/>
                </Button>

                <!-- Edit -->
                <Button Command="{Binding Edit}" Style="{DynamicResource ImageButtonStyle}">
                    <Image Source="/Catel.Articles.04 - Unit testing;component/Resources/Images/edit.png"/>
                </Button>

                <!-- Remove -->
                <Button Command="{Binding Remove}" Style="{DynamicResource ImageButtonStyle}">
                    <Image Source="/Catel.Articles.04 - Unit testing;component/Resources/Images/delete.png"/>
                </Button>
            </WrapPanel>
        </StackPanel>

        <!-- List of persons -->
        <ListBox DockPanel.Dock="Left" ItemsSource="{Binding PersonCollection}" SelectedItem="{Binding SelectedPerson}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseDoubleClick">
                    <catel:EventToCommand Command="{Binding Edit}" DisableAssociatedObjectOnCannotExecute="False" />
                </i:EventTrigger>
            </i:Interaction.Triggers>

            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Label Content="{Binding FullName}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </DockPanel>
</catel:DataWindow>
